#include <iostream>

using namespace std;

const int N = 1e5 + 10;

typedef long long LL;

int n, m;
LL a[N];
LL f[N]; // 差分数组

int main()
{
	cin >> n >> m;
	for(int i = 1; i <= n; i++)
	{
		cin >> a[i];
		f[i] = a[i] - a[i - 1];

		//方式二，利用性质创建差分数组
		//int x; cin >> x;
		//f[i] += x; 
		//f[i + 1] -= x
	}

	//处理m次操作
	while(m--)
	{
		int l, r, k; cin >> l >> r >> k;
		f[l] += k;
		f[r + 1] -= k;
	}

	//还原操作后的数组
	//f[1]=a[1],f[2]=a[2]-f[1]=>a[2]=f[1]+f[2]
	//f[3]=a[3]-a[2]=>a[3]=f[1]+f[2]+f[3]
	//差分数组的前缀和=对应下标的数组元素
	for(int i = 1; i <= n; i++)
	{
		a[i] = f[i] + a[i - 1];
		cout << a[i] << " ";

		//f[i] = f[i] + f[i - 1];
	}

	return 0;
}